﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using AnaxibiaStudios.Smug;

namespace SmugTest
{
#if DETOUR_ENABLED
  [TestClass]
  public class RealMethodAccessTest
  {
    [TestMethod]
    public void BasicRealMethodAccessTest()
    {
      var airplane = Create.Proxy<Airplane>();

      Prepare.Func<bool>(airplane.DropGear).Real();

      Assert.IsFalse(airplane.DropGear());
    }

    [TestMethod]
    public void RealAndNotifyTest()
    {
      var airplane = Create.Proxy<Airplane>();

      bool dropCalled = false;
      Prepare.Func<bool>(airplane.DropGear).Real(() => dropCalled = true);

      airplane.DropGear();
      Assert.IsTrue(dropCalled);
    }
  }
#endif
}
